<%@ page language="java" pageEncoding="utf-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<%
    String u = request.getParameter("user");
    String p = request.getParameter("pwd");
    if (u.equals("admin") && p.equals("admin")) {
        out.println("账号密码正确!");
        //存储进事务Session
        session.setAttribute("user", u);
        session.setAttribute("pwd", p);
    } else {
        //输入不对自动跳回
        response.sendRedirect("index.jsp");
    }
%>
<form action="bookDetail.jsp" method="post">
    图书 <select name="book">
    <option value="1">《红楼梦》</option>
    <option value="2">《水浒传》</option>
    <option value="3">《西游记》</option>
    <option value="4">《三国演义》</option>
</select> <br/>
    <label>
        你需要的数量：
        <%--value和name 分别是值和别名--%>
        <input type="text" name="num">
    </label> <br/>
    <input type="submit" value="提交">
    <input type="reset" value="清空">
</form>
</body>
</html>